package com.example.wotu;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

public class MyBRReceiver extends BroadcastReceiver {
    //广播接收者
    @Override
    public void onReceive(Context context, Intent intent) {
        int netWorkStates = NetworkUtil.getNetWorkStates(context);
        switch (netWorkStates) {
            case NetworkUtil.TYPE_NONE:
                Toast.makeText(context,"兄弟想看片？都没网了，想什么？",Toast.LENGTH_LONG).show();
                break;
            case NetworkUtil.TYPE_MOBILE:
                Toast.makeText(context,"你的移动网信不信啊！估摸看片有点难哦！",Toast.LENGTH_LONG).show();//打开了移动网络
                break;
            case NetworkUtil.TYPE_WIFI:
                //打开了WIFI
                Toast.makeText(context,"nice！兄弟，WIFI可以呀！现在飞起来都可以了！", Toast.LENGTH_LONG).show();//打开了移动网络
                break;
            default:
                break;
        }
    }
}
